from django.contrib import admin
from .models import Book, Author
from import_export import resources
from import_export.admin import ImportExportModelAdmin

class BookResource(resources.ModelResource):
    class Meta:
        model = Book

class BookAdmin(ImportExportModelAdmin):
    resource_class = BookResource

class AuthorResource(resources.ModelResource):
    class Meta:
        model = Author

class AuthorAdmin(ImportExportModelAdmin):
    resource_class = AuthorResource

admin.site.register(Book, BookAdmin)
admin.site.register(Author, AuthorAdmin)
